package com.example.blog.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;

@Data
@AllArgsConstructor
@NoArgsConstructor
@TableName("communication")
public class Communication {
   @TableId(type = IdType.AUTO)
   private Long id;  //信息id
   @Min( value = 1,message = "该值最小为1" )
   @NotBlank(message = "发送人不能为空")
   private long sender;    //发送用户

   @NotBlank(message = "接收人不能为空")
   private long recipient; //接受用户

   @NotBlank(message = "消息不能为空")
   private String message;

   @TableField("date_time")
   private String dateTime;  //信息时间

   private Integer state;  //是否已读

}
